package com.tang.model.vo;

/**
 * 规则树茎建造类
 * 
 * @author Tang
 */
public final class TreeNodeLinkBuilder {
    private Long nodeIdFrom;        //节点From
    private Long nodeIdTo;          //节点To
    private Integer ruleLimitType;  //限定类型；1:=;2:>;3:<;4:>=;5<=;6:enum[枚举范围]
    private Object ruleLimitValue;  //限定值

    private TreeNodeLinkBuilder() {
    }

    public static TreeNodeLinkBuilder builder() {
        return new TreeNodeLinkBuilder();
    }

    public TreeNodeLinkBuilder nodeIdFrom(Long nodeIdFrom) {
        this.nodeIdFrom = nodeIdFrom;
        return this;
    }

    public TreeNodeLinkBuilder nodeIdTo(Long nodeIdTo) {
        this.nodeIdTo = nodeIdTo;
        return this;
    }

    public TreeNodeLinkBuilder ruleLimitType(Integer ruleLimitType) {
        this.ruleLimitType = ruleLimitType;
        return this;
    }

    public TreeNodeLinkBuilder ruleLimitValue(Object ruleLimitValue) {
        this.ruleLimitValue = ruleLimitValue;
        return this;
    }

    public TreeNodeLink build() {
        TreeNodeLink treeNodeLink = new TreeNodeLink();
        treeNodeLink.setNodeIdFrom(nodeIdFrom);
        treeNodeLink.setNodeIdTo(nodeIdTo);
        treeNodeLink.setRuleLimitType(ruleLimitType);
        treeNodeLink.setRuleLimitValue(ruleLimitValue);
        return treeNodeLink;
    }
}
